package com.example.mine_platform.mapper;

import com.example.mine_platform.pojo.entities.Devices;
import com.example.mine_platform.pojo.entities.Material;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface DevicesMapper extends Mapper<Devices> {
    @Results(id = "deviceResultMap", value = {
            @Result(property = "id", column = "id"),
            @Result(property = "name", column = "name"),
            @Result(property = "describe", column = "device_describe"),
            @Result(property = "amount", column = "amount"),
            @Result(property = "produceDate", column = "produce_date"),
            @Result(property = "condition", column = "device_condition"),
            @Result(property = "createTime", column = "create_time"),
            @Result(property = "updateTime", column = "update_time"),
            @Result(property = "deleted", column = "deleted")
    })
    @Select("select * from devices where deleted=0")
    public List<Devices> getAllMaterials();
}